/********************************************************************
FileName    :   Dal_UserList.cs
CreateTime  :   2015-10-27 04:10
BaseClass   :   Dal_UserList
FileType    :   .cs
Author      :  minjie
Description :   Dal_UserListDAL层（简单三层）
*********************************************************************/

using System;
using System.Text;
using System.Data.SqlClient;
using System.Collections.Generic;

using System.Data;
namespace OS.DAL
{
	/// <summary>
	/// Dal_UserList的摘要说明。
	/// </summary>
	public partial class Dal_UserList 
  	{ 
     		      
  		public bool Exists(string UserNo) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select count(1) from UserList"); 
  			strSql.Append(" where "); 
           SqlParameter[] parameters = { new SqlParameter("@UserNo", SqlDbType.Int,4)};  
  			return DbHelperSQL.Exists(strSql.ToString(),parameters); 
  		} 
  		 
  				 
  		 
  		/// <summary> 
  		/// 增加一条数据 
  		/// </summary> 
  		public  bool  Add(UserList_Entity model) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("insert into UserList(");			 
  	strSql.Append("UserId,UserNo,UserPass,UserTName,UserDetail,UserTel,UserMobile,UserEmail,UserIcon,UserSex,UserZW,UserAge,UserRemark,UserAddress,UserWebSite,UserRole,UserLevel,UserState,UserLastLoginDateTime,UserCreateTime,LastUpdateFlag,UserRestrict) values ("); 
  	strSql.Append("	@UserId,@UserNo,@UserPass,@UserTName,@UserDetail,@UserTel,@UserMobile,@UserEmail,@UserIcon,@UserSex,@UserZW,@UserAge,@UserRemark,@UserAddress,@UserWebSite,@UserRole,@UserLevel,@UserState,@UserLastLoginDateTime,@UserCreateTime,@LastUpdateFlag,@UserRestrict	 ) "); 
  			SqlParameter[] parameters = { 
              new SqlParameter("@UserId", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserNo", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserPass", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserTName", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserDetail", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserTel", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserMobile", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserEmail", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserIcon", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserSex", SqlDbType.Int,4) ,              
              new SqlParameter("@UserZW", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserAge", SqlDbType.Int,4) ,              
              new SqlParameter("@UserRemark", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserAddress", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserWebSite", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserRole", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserLevel", SqlDbType.Int,4) ,              
              new SqlParameter("@UserState", SqlDbType.TinyInt) ,              
              new SqlParameter("@UserLastLoginDateTime", SqlDbType.DateTime) ,              
              new SqlParameter("@UserCreateTime", SqlDbType.DateTime) ,              
              new SqlParameter("@LastUpdateFlag", SqlDbType.UniqueIdentifier) ,              
              new SqlParameter("@UserRestrict", SqlDbType.VarChar,50)};             
           if (model.UserId != null)  
              parameters[0].Value = model.UserId;  
           else  
              parameters[0].Value = DBNull.Value;  
              
           if (model.UserNo != null)  
              parameters[1].Value = model.UserNo;  
           else  
              parameters[1].Value = DBNull.Value;  
              
           if (model.UserPass != null)  
              parameters[2].Value = model.UserPass;  
           else  
              parameters[2].Value = DBNull.Value;  
              
           if (model.UserTName != null)  
              parameters[3].Value = model.UserTName;  
           else  
              parameters[3].Value = DBNull.Value;  
              
           if (model.UserDetail != null)  
              parameters[4].Value = model.UserDetail;  
           else  
              parameters[4].Value = DBNull.Value;  
              
           if (model.UserTel != null)  
              parameters[5].Value = model.UserTel;  
           else  
              parameters[5].Value = DBNull.Value;  
              
           if (model.UserMobile != null)  
              parameters[6].Value = model.UserMobile;  
           else  
              parameters[6].Value = DBNull.Value;  
              
           if (model.UserEmail != null)  
              parameters[7].Value = model.UserEmail;  
           else  
              parameters[7].Value = DBNull.Value;  
              
           if (model.UserIcon != null)  
              parameters[8].Value = model.UserIcon;  
           else  
              parameters[8].Value = DBNull.Value;  
              
           if (model.UserSex != null)  
              parameters[9].Value = model.UserSex;  
           else  
              parameters[9].Value = DBNull.Value;  
              
           if (model.UserZW != null)  
              parameters[10].Value = model.UserZW;  
           else  
              parameters[10].Value = DBNull.Value;  
              
           if (model.UserAge != null)  
              parameters[11].Value = model.UserAge;  
           else  
              parameters[11].Value = DBNull.Value;  
              
           if (model.UserRemark != null)  
              parameters[12].Value = model.UserRemark;  
           else  
              parameters[12].Value = DBNull.Value;  
              
           if (model.UserAddress != null)  
              parameters[13].Value = model.UserAddress;  
           else  
              parameters[13].Value = DBNull.Value;  
              
           if (model.UserWebSite != null)  
              parameters[14].Value = model.UserWebSite;  
           else  
              parameters[14].Value = DBNull.Value;  
              
           if (model.UserRole != null)  
              parameters[15].Value = model.UserRole;  
           else  
              parameters[15].Value = DBNull.Value;  
              
           if (model.UserLevel != null)  
              parameters[16].Value = model.UserLevel;  
           else  
              parameters[16].Value = DBNull.Value;  
              
           if (model.UserState != null)  
              parameters[17].Value = model.UserState;  
           else  
              parameters[17].Value = DBNull.Value;  
              
           if (model.UserLastLoginDateTime != null)  
              parameters[18].Value = model.UserLastLoginDateTime;  
           else  
              parameters[18].Value = DBNull.Value;  
              
           if (model.UserCreateTime != null)  
              parameters[19].Value = model.UserCreateTime;  
           else  
              parameters[19].Value = DBNull.Value;  
              
              parameters[20].Value =Guid.NewGuid();  
           if (model.UserRestrict != null)  
              parameters[21].Value = model.UserRestrict;  
           else  
              parameters[21].Value = DBNull.Value;  
              
  			int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);			 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
              return false;; 
           }  
  		} 
  		 
  		/// <summary> 
  		/// 增加一条数据(字符串) 
  		/// </summary> 
  		public  string  AddStr(UserList_Entity model) 
  		{ 
  				if(model.UserId==null) 
  				{ 
  					model.UserId="";  
  				} 
  				if(model.UserNo==null) 
  				{ 
  					model.UserNo="";  
  				} 
  				if(model.UserPass==null) 
  				{ 
  					model.UserPass="";  
  				} 
  				if(model.UserTName==null) 
  				{ 
  					model.UserTName="";  
  				} 
  				if(model.UserDetail==null) 
  				{ 
  					model.UserDetail="";  
  				} 
  				if(model.UserTel==null) 
  				{ 
  					model.UserTel="";  
  				} 
  				if(model.UserMobile==null) 
  				{ 
  					model.UserMobile="";  
  				} 
  				if(model.UserEmail==null) 
  				{ 
  					model.UserEmail="";  
  				} 
  				if(model.UserIcon==null) 
  				{ 
  					model.UserIcon="";  
  				} 
  				if(model.UserSex==null) 
  				{ 
  					model.UserSex=0; 
  				} 
  				if(model.UserZW==null) 
  				{ 
  					model.UserZW="";  
  				} 
  				if(model.UserAge==null) 
  				{ 
  					model.UserAge=0; 
  				} 
  				if(model.UserRemark==null) 
  				{ 
  					model.UserRemark="";  
  				} 
  				if(model.UserAddress==null) 
  				{ 
  					model.UserAddress="";  
  				} 
  				if(model.UserWebSite==null) 
  				{ 
  					model.UserWebSite="";  
  				} 
  				if(model.UserRole==null) 
  				{ 
  					model.UserRole="";  
  				} 
  				if(model.UserLevel==null) 
  				{ 
  					model.UserLevel=0; 
  				} 
  				if(model.UserRestrict==null) 
  				{ 
  					model.UserRestrict="";  
  				} 
  		 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("insert into UserList(");			 
  	strSql.Append("UserId,UserNo,UserPass,UserTName,UserDetail,UserTel,UserMobile,UserEmail,UserIcon,UserSex,UserZW,UserAge,UserRemark,UserAddress,UserWebSite,UserRole,UserLevel,UserState,UserLastLoginDateTime,UserCreateTime,LastUpdateFlag,UserRestrict) values ("); 
  	strSql.Append("	'"+ model.UserId+"','"+ model.UserNo+"','"+ model.UserPass+"','"+ model.UserTName+"','"+ model.UserDetail+"','"+ model.UserTel+"','"+ model.UserMobile+"','"+ model.UserEmail+"','"+ model.UserIcon+"',"+ model.UserSex+",'"+ model.UserZW+"',"+ model.UserAge+",'"+ model.UserRemark+"','"+ model.UserAddress+"','"+ model.UserWebSite+"','"+ model.UserRole+"',"+ model.UserLevel+",'"+ model.UserLastLoginDateTime+"','"+ model.UserCreateTime+"','" +model.UserRestrict+"'	 ) "); 
           return strSql.ToString(); 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 更新一条数据 
  		/// </summary> 
  		public bool Update(UserList_Entity model) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("update UserList set "); 
              strSql.Append(" UserId = @UserId,"); 
              strSql.Append(" UserNo = @UserNo,"); 
              strSql.Append(" UserPass = @UserPass,"); 
              strSql.Append(" UserTName = @UserTName,"); 
              strSql.Append(" UserDetail = @UserDetail,"); 
              strSql.Append(" UserTel = @UserTel,"); 
              strSql.Append(" UserMobile = @UserMobile,"); 
              strSql.Append(" UserEmail = @UserEmail,"); 
              strSql.Append(" UserIcon = @UserIcon,"); 
              strSql.Append(" UserSex = @UserSex,"); 
              strSql.Append(" UserZW = @UserZW,"); 
              strSql.Append(" UserAge = @UserAge,"); 
              strSql.Append(" UserRemark = @UserRemark,"); 
              strSql.Append(" UserAddress = @UserAddress,"); 
              strSql.Append(" UserWebSite = @UserWebSite,"); 
              strSql.Append(" UserRole = @UserRole,"); 
              strSql.Append(" UserLevel = @UserLevel,"); 
              strSql.Append(" UserState = @UserState,"); 
              strSql.Append(" UserLastLoginDateTime = @UserLastLoginDateTime,"); 
              strSql.Append(" UserCreateTime = @UserCreateTime,"); 
              strSql.Append(" LastUpdateFlag = @LastUpdateFlag,"); 
              strSql.Append(" UserRestrict = @UserRestrict"); 
  			strSql.Append(" where  UserNo=@UserNo "); 
  						 
  SqlParameter[] parameters = { 
              new SqlParameter("@UserId", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserNo", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserPass", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserTName", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserDetail", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserTel", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserMobile", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserEmail", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserIcon", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserSex", SqlDbType.Int,4) ,              
              new SqlParameter("@UserZW", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserAge", SqlDbType.Int,4) ,              
              new SqlParameter("@UserRemark", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserAddress", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserWebSite", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserRole", SqlDbType.NVarChar,255) ,              
              new SqlParameter("@UserLevel", SqlDbType.Int,4) ,              
              new SqlParameter("@UserState", SqlDbType.TinyInt) ,              
              new SqlParameter("@UserLastLoginDateTime", SqlDbType.DateTime) ,              
              new SqlParameter("@UserCreateTime", SqlDbType.DateTime) ,              
              new SqlParameter("@LastUpdateFlag", SqlDbType.UniqueIdentifier) ,              
              new SqlParameter("@UserRestrict", SqlDbType.VarChar,50)};             
           if (model.UserId != null)  
              parameters[0].Value = model.UserId;  
           else  
              parameters[0].Value = DBNull.Value;  
              
           if (model.UserNo != null)  
              parameters[1].Value = model.UserNo;  
           else  
              parameters[1].Value = DBNull.Value;  
              
           if (model.UserPass != null)  
              parameters[2].Value = model.UserPass;  
           else  
              parameters[2].Value = DBNull.Value;  
              
           if (model.UserTName != null)  
              parameters[3].Value = model.UserTName;  
           else  
              parameters[3].Value = DBNull.Value;  
              
           if (model.UserDetail != null)  
              parameters[4].Value = model.UserDetail;  
           else  
              parameters[4].Value = DBNull.Value;  
              
           if (model.UserTel != null)  
              parameters[5].Value = model.UserTel;  
           else  
              parameters[5].Value = DBNull.Value;  
              
           if (model.UserMobile != null)  
              parameters[6].Value = model.UserMobile;  
           else  
              parameters[6].Value = DBNull.Value;  
              
           if (model.UserEmail != null)  
              parameters[7].Value = model.UserEmail;  
           else  
              parameters[7].Value = DBNull.Value;  
              
           if (model.UserIcon != null)  
              parameters[8].Value = model.UserIcon;  
           else  
              parameters[8].Value = DBNull.Value;  
              
           if (model.UserSex != null)  
              parameters[9].Value = model.UserSex;  
           else  
              parameters[9].Value = DBNull.Value;  
              
           if (model.UserZW != null)  
              parameters[10].Value = model.UserZW;  
           else  
              parameters[10].Value = DBNull.Value;  
              
           if (model.UserAge != null)  
              parameters[11].Value = model.UserAge;  
           else  
              parameters[11].Value = DBNull.Value;  
              
           if (model.UserRemark != null)  
              parameters[12].Value = model.UserRemark;  
           else  
              parameters[12].Value = DBNull.Value;  
              
           if (model.UserAddress != null)  
              parameters[13].Value = model.UserAddress;  
           else  
              parameters[13].Value = DBNull.Value;  
              
           if (model.UserWebSite != null)  
              parameters[14].Value = model.UserWebSite;  
           else  
              parameters[14].Value = DBNull.Value;  
              
           if (model.UserRole != null)  
              parameters[15].Value = model.UserRole;  
           else  
              parameters[15].Value = DBNull.Value;  
              
           if (model.UserLevel != null)  
              parameters[16].Value = model.UserLevel;  
           else  
              parameters[16].Value = DBNull.Value;  
              
           if (model.UserState != null)  
              parameters[17].Value = model.UserState;  
           else  
              parameters[17].Value = DBNull.Value;  
              
           if (model.UserLastLoginDateTime != null)  
              parameters[18].Value = model.UserLastLoginDateTime;  
           else  
              parameters[18].Value = DBNull.Value;  
              
           if (model.UserCreateTime != null)  
              parameters[19].Value = model.UserCreateTime;  
           else  
              parameters[19].Value = DBNull.Value;  
              
           if (model.LastUpdateFlag != null)  
              parameters[20].Value = model.LastUpdateFlag;  
           else  
              parameters[20].Value = DBNull.Value;  
              
           if (model.UserRestrict != null)  
              parameters[21].Value = model.UserRestrict;  
           else  
              parameters[21].Value = DBNull.Value;  
              
              int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
  				return false; 
  			} 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 删除一条数据 
  		/// </summary> 
  		public bool Delete(string  UserNo) 
  		{ 
  			 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("delete from UserList "); 
  			strSql.Append(" where  UserNo=@UserNo"); 
  			SqlParameter[] parameters = {  new SqlParameter("@UserNo", SqlDbType.NVarChar,255) };  
    parameters[0].Value = UserNo;  
   
  			int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
  				return false; 
  			} 
  		} 
  		 
  		/// <summary> 
  		/// 批量删除一批数据 
  		/// </summary> 
  		public bool DeleteList(string UserNolist ) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("delete from UserList "); 
  			strSql.Append(" where ID in ("+UserNolist + ")  "); 
  			int rows=DbHelperSQL.ExecuteSql(strSql.ToString()); 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
  				return false; 
  			} 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 得到一个对象实体 
  		/// </summary> 
  		public UserList_Entity GetModel(string   UserNo) 
  		{ 
  			 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select  UserId,UserNo,UserPass,UserTName,UserDetail,UserTel,UserMobile,UserEmail,UserIcon,UserSex,UserZW,UserAge,UserRemark,UserAddress,UserWebSite,UserRole,UserLevel,UserState,UserLastLoginDateTime,UserCreateTime,LastUpdateFlag,UserRestrict");	
		strSql.Append("  from UserList"); 
  			strSql.Append(" where  UserNo=@UserNo "); 
  			SqlParameter[] parameters = {  new SqlParameter("@UserNo", SqlDbType.NVarChar,255) };  
    parameters[0].Value = UserNo;  
  			 
  			UserList_Entity model=new UserList_Entity(); 
  			DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters); 
  			 
  			if(ds!=null&&ds.Tables[0].Rows.Count>0) 
  			{ 
  		DataTable dt=ds.Tables[0];	  
  				model.UserId= dt.Rows[0]["UserId"].ToString(); 
  				model.UserNo= dt.Rows[0]["UserNo"].ToString(); 
  				model.UserPass= dt.Rows[0]["UserPass"].ToString(); 
  				model.UserTName= dt.Rows[0]["UserTName"].ToString(); 
  				model.UserDetail= dt.Rows[0]["UserDetail"].ToString(); 
  				model.UserTel= dt.Rows[0]["UserTel"].ToString(); 
  				model.UserMobile= dt.Rows[0]["UserMobile"].ToString(); 
  				model.UserEmail= dt.Rows[0]["UserEmail"].ToString(); 
  				model.UserIcon= dt.Rows[0]["UserIcon"].ToString(); 
  				if(dt.Rows[0]["UserSex"]!=null&&dt.Rows[0]["UserSex"].ToString()!="") 
  				{ 
  					model.UserSex=int.Parse(dt.Rows[0]["UserSex"].ToString()); 
  				} 
  				model.UserZW= dt.Rows[0]["UserZW"].ToString(); 
  				if(dt.Rows[0]["UserAge"]!=null&&dt.Rows[0]["UserAge"].ToString()!="") 
  				{ 
  					model.UserAge=int.Parse(dt.Rows[0]["UserAge"].ToString()); 
  				} 
  				model.UserRemark= dt.Rows[0]["UserRemark"].ToString(); 
  				model.UserAddress= dt.Rows[0]["UserAddress"].ToString(); 
  				model.UserWebSite= dt.Rows[0]["UserWebSite"].ToString(); 
  				model.UserRole= dt.Rows[0]["UserRole"].ToString(); 
  				if(dt.Rows[0]["UserLevel"]!=null&&dt.Rows[0]["UserLevel"].ToString()!="") 
  				{ 
  					model.UserLevel=int.Parse(dt.Rows[0]["UserLevel"].ToString()); 
  				} 
  				if(dt.Rows[0]["UserLastLoginDateTime"]!=null&&dt.Rows[0]["UserLastLoginDateTime"].ToString()!="") 
  				{ 
  					model.UserLastLoginDateTime=DateTime.Parse(dt.Rows[0]["UserLastLoginDateTime"].ToString()); 
  				} 
  				if(dt.Rows[0]["UserCreateTime"]!=null&&dt.Rows[0]["UserCreateTime"].ToString()!="") 
  				{ 
  					model.UserCreateTime=DateTime.Parse(dt.Rows[0]["UserCreateTime"].ToString()); 
  				} 
  				model.UserRestrict= dt.Rows[0]["UserRestrict"].ToString(); 
  				return model; 
  			} 
  			else 
  			{ 
  				return null; 
  			} 
  		} 
  		 
  		/// <summary> 
  		/// 分页获取数据列表 
  		/// </summary> 
  		public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  		 strSql.Append("SELECT * FROM ( "); 
  		 strSql.Append(" SELECT ROW_NUMBER() OVER ("); 
  if (!string.IsNullOrEmpty(orderby.Trim())) 
 { 
    strSql.Append("order by T." + orderby); 
 } 
else  
 { 
     strSql.Append("order by T.UserNo desc"); 
 } 
		 strSql.Append(")AS Row, T.*  from UserList T "); 
  		 if (!string.IsNullOrEmpty(strWhere.Trim()))  
  			{ 
  			 strSql.Append(" WHERE " + strWhere); 
  			} 
  		    strSql.Append(" ) TT"); 
  	        strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);			return DbHelperSQL.Query(strSql.ToString()); 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 获得数据列表 
  		/// </summary> 
  		public DataSet GetList(string strWhere) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select * "); 
  			strSql.Append(" FROM UserList "); 
  			if(strWhere.Trim()!="") 
  			{ 
  				strSql.Append(" where "+strWhere); 
  			} 
  			return DbHelperSQL.Query(strSql.ToString()); 
  		} 
  		 
  		/// <summary> 
  		/// 获得前几行数据 
  		/// </summary> 
  		public DataSet GetList(int Top,string strWhere,string filedOrder) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select "); 
  			if(Top>0) 
  			{ 
  				strSql.Append(" top "+Top.ToString()); 
  			} 
  			strSql.Append(" * "); 
  			strSql.Append(" FROM UserList "); 
  			if(strWhere.Trim()!="") 
  			{ 
  				strSql.Append(" where "+strWhere); 
  			} 
  			strSql.Append(" order by " + filedOrder); 
  			return DbHelperSQL.Query(strSql.ToString()); 
  		} 
  		 
  		/// <summary> 
  		/// 获得记录条数 
  		/// </summary> 
  		public int GetRecordCount(string strWhere) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select count(1) "); 
  			strSql.Append(" FROM UserList "); 
  			if(strWhere.Trim()!="") 
  			{ 
  				strSql.Append(" where "+strWhere); 
  			} 
  		   object obj=	DbHelperSQL.GetSingle(strSql.ToString()); 
  			if(obj!=null && obj.ToString()!="") 
  			{ 
              	return Convert.ToInt32(obj); 
  			} 
  			else 
  			return 0; 
  		} 
   
      
  	} 
  
}
